package com.golang.api.util;

/**
 * 通用相应码
 */
public enum CommonRespCode implements StatusEnumSupport {
  /**
   * 基本返回码
   */
  SUCCESS(200, "SUCCESS"),
  ERROR(500, "抱歉，当前值班小哥翘班我们马上报告老板！"),
  FAILURE(501, "业务请求处理失败"),//这并不是异常
  ILLEGAL_REQUEST(100, "非法请求"),

  // http request
  REQUEST_NOT_SUPPORT(100900, "不支持的请求"),
  REQUEST_NOT_SUPPORT_METHOD(100901, "不支持的请求方式"),
  REQUEST_NOT_SUPPORT_MEDIA_TYPE(100902, "不支持的MediaType"),
  REQUEST_BIND_ARGUMENT_ERROR(100903, "请求绑定参数异常"),
  REQUEST_NOT_READABLE(100904, "请求消息不可读"),
  REQUEST_PARAM_TYPE_MISMATCH(100905, "请求参数类型转换异常"),

  // valid
  VALID_BEAN_ILLEGAL_ARGUMENT(100984, "属性参数校验失败"),
  VALID_CLASS_ILLEGAL_ARGUMENT(100985, "类参数校验失败"),
  VALID_SERVICE_ILLEGAL_ARGUMENT(100986, "业务层参数校验失败"),

  /**
   * 业务相关
   */
  REQUEST_FREQUENTLY(200001, "亲，手速太快了！"),

  ;
  private final Integer code;
  private final String message;
  
  CommonRespCode (Integer code, String message) {
    this.code = code;
    this.message = message;
  }


  @Override
  public Integer getCode () {
    return this.code;
  }

  @Override
  public String getMessage () {
    return this.message;
  }

}
